package com.sinog.front.feign.biz.common;

import com.sinog.core.domain.Department;
import com.sinog.core.domain.SystemCode;
import com.sinog.core.model.UserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;

/**
 * @desc 系统公用的service
 * @author -
 * @date -
 */
@FeignClient("sinog2c-biz")
public interface CommonService {

    /**
     * 获取下拉框数据
     * @param codeType codeType
     * @return List<Map < String,Object>>
     */
    @RequestMapping("/azbj/getComboboxData")
    List<Map<String,Object>> getComboboxData(@RequestParam("codeType") String codeType);

    /**
     * 获取省市县信息
     * @param codeType 行政区划的code_type默认为2_1
     * @param codeId 选中的code编码
     * @param flag flag = 1，代表只查询本系统的省份
     * @return List<Map < String,Object>>
     */
    @RequestMapping("/azbj/getCodeDetail")
    List<Map<String,Object>> getCodeDetail(
            @RequestParam("codeType") String codeType,
            @RequestParam("codeId") String codeId,@RequestParam("flag") String flag);

    /**
     * 获取部门
     * @param id 当前部门编号
     * @return Department
     */
    @RequestMapping("/azbj/transfer/fqqy/getDepartmentById")
    Department getDepartmentById(@RequestParam(value = "id", required = false) String id);

    /**
     * 获取下拉框数据
     * @param departid departid
     * @return List<Map < String,String>>
     */
    @RequestMapping("/azbj/getJyData")
    List<Map<String,String>> getJyData(@RequestParam("departid") String departid);

    /**
     * 查询tbsys_code编码
     * @param codeType 编码类型
     * @param pcodeId 父级编码  0 不启用  99表示不等于-1
     * @param sn 是否排序：-1 不排序 0 desc 1 asc
     * @param userDTO 登录用户信息
     * @return List<Map<String,Object>>
     */
    @RequestMapping("/azbj/inmates/baseinfo/getTbsysCode")
    List<Map<String,Object>> getTbsysCode(
            @RequestParam("codeType") String codeType,
            @RequestParam("pcodeId") String pcodeId,@RequestParam("sn") String sn,@RequestBody UserDTO userDTO);

    /**
     * 根据code获取name
     * @param code code
     * @return String
     */
    @RequestMapping("/azbj/yazgl/getCodeName")
    String getCodeNameByCode(@RequestParam("code") String code);

    /**
     * 根据CodeName获取字典信息
     * @param mapCode mapCode
     * @param name 地区名
     * @return SystemCode
     */
    @RequestMapping("/azbj/yazgl/getTbsysCodeByCodeName")
    SystemCode getTbsysCodeByCodeName(@RequestParam("mapCode")String mapCode, @RequestParam("name")String name);

    /**
     * 获取mapcode下的所有子地区的code
     * @param mapCode 区划编码
     * @return List<String>
     */
    @RequestMapping("/azbj/wxsxq/getChildCodesByPcode")
    List<String> getChildCodesByPcode(@RequestParam("mapCode") String mapCode);

    /**
     * 获取街道
     * @param codeType codeType
     * @param codeId codeId
     * @return List<Map < String,Object>>
     */
    @RequestMapping("/azbj/bjdxInfo/getDepart")
    List<Map<String,Object>> getDepart(
            @RequestParam(value = "codeType", required = false) String codeType,
            @RequestParam(value = "codeId", required = false) String codeId);

    /**
     * 获取省市县
     * @param parentCode parentCode
     * @return List<Map < String,Object>>
     */
    @RequestMapping("/azbj/bjdxInfo/getStreet")
    List<Map<String,Object>> getStreet(@RequestParam(value = "parentCode", required = false) String parentCode);

    /**
     * 获取所有的省份，用来选择监狱
     * @return List<SystemCode>
     */
    @GetMapping("/azbj/inmates_bl/baseinfo/getAllProvince")
    List<SystemCode> getAllProvince();

    /**
     * 根据角色查询帮扶范围
     * @param roleid 角色
     * @param flog flog
     * @return List<Map<String,Object>>
     */
    @RequestMapping("/azbj/bffw/getBffw")
    List<Map<String,Object>> getBffw(@RequestParam("roleid") String roleid, @RequestParam("flog") String flog);

    /**
     * 获取省市县锁定信息
     * @param userDTO userDTO
     * @return Map<String,Object>
     */
    @RequestMapping("/azbj/getAddressLocking")
    Map<String,Object> getAddressLocking(@RequestBody UserDTO userDTO);
}